package org.example.diet_compass.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.example.diet_compass.domain.OrderItems;
import org.example.diet_compass.mapper.OrderItemsMapper;
import org.example.diet_compass.service.OrderItemsService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
* @author 86135
* @description 针对表【order_items(存储订单与商品之间关系的中间表，记录每个订单中包含哪些商品及数量)】的数据库操作Service实现
* @createDate 2025-03-16 11:01:05
*/
@Service
public class OrderItemsServiceImpl extends ServiceImpl<OrderItemsMapper, OrderItems>
    implements OrderItemsService {
    @Resource
    private OrderItemsMapper orderItemsMapper;

    @Override
    public List<Map<String,Object>> getGoodIdsAndCountByOrderId(Integer orderId) {
       return orderItemsMapper.getGoodIdsAndCountByOrderId(orderId);
    }
}




